package sky.springboot.learn_01.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class HelloController {

    @Autowired
    RedisTemplate redisTemplate;
    @Autowired
    HashOperations hashOperations;

    @RequestMapping
    public String hello() {
        hashOperations.put("key","value","value2");
        String hv = (String) hashOperations.get("key","value");
        return hv;
    }
}
